package com.ropeok.controller;
import com.ropeok.common.ResponseResult;
import com.ropeok.entity.Privilege;
import com.ropeok.service.PrivilegeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


import java.util.List;

/**
 * @BelongsProject: training-mission
 * @BelongsPackage: com.ropeok.controller
 * @Author: zhofeifan
 * @CreateTime: 2022-08-29  10:24
 * @Description: TODO
 * @Version: 1.0
 */
public class PrivilegeController {
    private PrivilegeService privilegeService;

    @GetMapping("/privilege/{id}")
    public ResponseResult findPrivilegeByID(@PathVariable long id) {
        Privilege privilege = privilegeService.findPrivilegeByID(id);
        if (privilege == null) {
            //说明没有改权限
            return new ResponseResult(444, "没有角色");
        }
        return  new ResponseResult(666,"操作成功",privilege);
    }

}
